<?php include 'header-inc.php'; ?>

    <div id="inner-wrap">
        <div id="sidebar">
<?php include 'sidebar-inc.php'; ?>

        </div>
        <div id="content-box">
            <div class="inner-box">
                <div class="cmd">
                    <ul>
                        <li><a href="<?php echo $this->_url($_GET[FLEA::getAppInf( 'controllerAccessor' )], null, array(array(FLEA::getAppInf( 'columnAccessor' ) => $_colkey))); ?>">返回产品列表</a></li>
                        <li><a href="<?php echo $this->_url($_GET[FLEA::getAppInf( 'controllerAccessor' )], 'sort', array(array(FLEA::getAppInf( 'columnAccessor' ) => $_colkey))); ?>">产品排序</a></li>
                    </ul>
                </div>
                <?php if(!$data['categories']): ?>
                <span class="tips">尚未添加任何分类，请先<a href="<?php echo $this->_url($_GET[FLEA::getAppInf( 'controllerAccessor' )], 'addcategory', array(array(FLEA::getAppInf( 'columnAccessor' ) => $_colkey))); ?>">添加分类</a>。</span>
                <?php endif; ?>
                <div class="formbox box">
                <form method="post" action="<?php echo $this->_url('products', 'saveproduct'); ?>" enctype="multipart/form-data">
                    <h3>产品</h3>
                    <table>
                        <tr>
                            <th>所属分类：</th>
                            <td><?php $this->getControl('categories', 'cate_id', array('rows'=>$data['categories'], 'selected'=>$data['row']['cate_id'])); ?></td>
                        </tr>
                        <tr>
                            <th>产品名称：</th>
                            <td><input type="text" id="title" name="title" value="<?php echo h($data['row']['title']); ?>" /></td>
                        </tr>
                        <?php if($data['row']['attachments']): ?>
                        <tr>
                            <th>查看图片：</th>
                            <td><?php echo getImg($data['row']['attachments'], 'thumb'); ?></td>
                        </tr>
                        <?php endif; ?>
                        <tr>
                            <th>产品图片：</th>
                            <td><input type="file" id="pic" name="pic" /></td>
                        </tr>
                        <tr>
                            <th>产品说明：</th>
                            <td><?php $this->getControl('fck', 'content', array('height'=>350, 'value'=>$data['row']['content'])); ?></td>
                        </tr>
                        <tr>
                            <th></th>
                            <td><input type="submit" value="保 存" /> <input type="reset" value="重 置" /></td>
                        </tr>
                    </table>
                    <input type="hidden" id="id" name="id" value="<?php echo $data['row']['id']; ?>" />
                    <input type="hidden" id="site_id" name="site_id" value="<?php echo $_GET['site']; ?>" />
                    <input type="hidden" id="colkey" name="colkey" value="<?php echo $_GET[FLEA::getAppInf( 'columnAccessor' )]; ?>" />
                </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
